<?php $this->display('header');?>
<div class="bk_10"></div>
<table class="table_list mar_l_8" border="0" cellspacing="0" cellpadding="0" width="98%">
	<tr>
		<th width="40"><input type="checkbox" name="ss" id="check_all" /> </th>
		<th width="80">任务名称</th>
		<th>标题</th>
		<th>操作</th>
	</tr>
<?php foreach ($data as $v):?>
	<tr>
		<td class="t_c"><input type="checkbox" id="chk_row_<?=$v['contentid']?>" name="id" value="<?=$v['contentid']?>"/></td>
		<td class="t_l"><a href="<?=url('caitu/content/index',array('missionid'=>$v['missionid']))?>"><?=$v['name']?></td>
		<td class="t_l"><a href="<?=url('show/content/content',array('contentid'=>$v['contentid']))?>" target="_blank" title="<?=$v['contentid']?>"><?=$v['title']?></a></td>
		<td class="t_c"><?php if(!$v['fetched']):?><a href="<?=url('caitu/content/fetch',array('contentid'=>$v['contentid']))?>">采集</a><?php else:?><a style="color:red" href="<?=url('caitu/content/refetch',array('contentid'=>$v['contentid']))?>" onclick="return confirm('确认重新采集此内容？')?true:false;">重采</a><?php endif;?>&nbsp;&nbsp;<a href="javascript:;" onclick="content.view(<?=$v['contentid']?>);">查看</a>&nbsp;&nbsp;<a href="#">发布</a>&nbsp;&nbsp;<a href="<?=url('caitu/content/delete',array('contentid'=>$v['contentid']))?>" onclick="return confirm('确认重新删除此内容？')?true:false;">删除</a></td>
	</tr>
<?php endforeach;?>
</table>
<div class="table_foot"><ul class="pages">
<?=pages($total,$page,$pagesize,$offset,null,true)?>
</ul><p class="f_l" style="padding-left:40px;margin-top:10px;"><input type="button" class="button_style_2" title="采集" onclick="content.fetch()" value="采集"/></p></div>

<script type="text/javascript" src="<?=IMG_URL?>js/lib/jquery.lightbox.js"></script>
<link rel="stylesheet" type="text/css" href="<?=IMG_URL?>css/imagesbox.css" />
<script type="text/javascript">
$.lightBox.setOption({
	imageLoading:			'<?=IMG_URL?>images/lightBox/lightbox-ico-loading.gif',
	imageBtnPrev:			'<?=IMG_URL?>images/lightBox/lightbox-btn-prev.gif',	
	imageBtnNext:			'<?=IMG_URL?>images/lightBox/lightbox-btn-next.gif',
	imageBtnClose:			'<?=IMG_URL?>images/lightBox/lightbox-btn-close.gif',
	imageBlank:				'<?=IMG_URL?>images/lightBox/lightbox-blank.gif',
	txtImage : '图片',
	txtOf : ' / '

});
var content = {
	view : function(contentid)
	{
		$.lightBox.request('?app=caitu&controller=content&action=view&contentid='+contentid,contentid);
	},
	fetch : function(contentid)
	{
		var ids = [];
		$('input[name="id"]:checked').each(function(){
			ids.push(this.value);
		});
		window.location = '<?=url('caitu/content/fetch')?>&contentid='+encodeURIComponent(ids.join(','));
	}
}
$(function(){
	$('#check_all').click(function(){
		$('input[name="id"]').attr('checked',this.checked);
	})
})

</script>
<?php $this->display('footer');